package com.atmilan.quartz.model.entity.crmeb;

import java.io.Serializable;
import java.math.BigDecimal;

import com.atmilan.quartz.model.dto.crmeb.StoreProductCrmebRequest;
import com.atmilan.quartz.sync.push.crmeb.domain.StoreProductRequest;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 商品详情表
 * @author daigb
 * @date:  2022-05-07 17:55
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("eb_store_product_description")
@ApiModel(value="StoreProductDescription对象", description="")
public class StoreProductDescription implements Serializable {
    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "商品id")
    private Integer productId;

    @ApiModelProperty(value = "商品图片")
    private String image;

    @ApiModelProperty(value = "轮播图")
    private String sliderImage;
    
    @ApiModelProperty(value = "单位")
    private String unitName;
    
    @ApiModelProperty(value = "成分")
    private String composition;
    
    @ApiModelProperty(value = "规格")
    private String dimension;
    
    @ApiModelProperty(value = "小视频")
    private String video;
    
    @ApiModelProperty(value = "官网实拍图")
    private String gwpp1;
    
    @ApiModelProperty(value = "官网模特图")
    private String gwmt1;
    
    @ApiModelProperty(value = "店拍实拍图")
    private String sp1;
    
    @ApiModelProperty(value = "自有实拍图")
    private String sp;
    
    @ApiModelProperty(value = "店拍模特图")
    private String mt1;
    
    @ApiModelProperty(value = "自有模特图")
    private String mt;
    
    @ApiModelProperty(value = "明星海报图")
    private String mx1;
    
    @ApiModelProperty(value = "自拍视频图")
    private String sp2;
    
    @ApiModelProperty(value = "店拍视频图")
    private String sp3;
    
    @ApiModelProperty(value = "重量")
    private BigDecimal weight;
    
    @ApiModelProperty(value = "产地")
    private String productionPlace;
    
    @ApiModelProperty(value = "商品详情")
    private String description;
    
    /**
     * 新建商品详情对象(会覆盖所有数据)
     * @author daigb
     * @date:  2022-05-07 18:06
     */
    public static StoreProductDescription getDescriptionByRequest(StoreProductRequest request) {
    	StoreProductDescription storeProductDescription = new StoreProductDescription();
    	storeProductDescription.setProductId(request.getId());
//    	storeProductDescription.setImage(request.getImage());
//    	storeProductDescription.setSliderImage(request.getSliderImage());
    	storeProductDescription.setUnitName(request.getUnitName());
    	storeProductDescription.setComposition(request.getComposition());
    	storeProductDescription.setDimension(request.getDimension());
    	storeProductDescription.setVideo(request.getVideo());
    	storeProductDescription.setGwpp1(request.getGwpp1());
    	storeProductDescription.setGwmt1(request.getGwmt1());
    	storeProductDescription.setSp1(request.getSp1());
    	storeProductDescription.setSp(request.getSp());
    	storeProductDescription.setMt1(request.getMt1());
    	storeProductDescription.setMt(request.getMt());
    	storeProductDescription.setMx1(request.getMx1());
    	storeProductDescription.setSp2(request.getSp2());
    	storeProductDescription.setSp3(request.getSp3());
    	storeProductDescription.setWeight(request.getWeight());
    	storeProductDescription.setProductionPlace(request.getProductionPlace());
    	storeProductDescription.setDescription(request.getStoreInfo());
    	
    	return storeProductDescription;
    }
    
    public static StoreProductDescription getDescriptionByProduct(StoreProduct request) {
    	StoreProductDescription storeProductDescription = new StoreProductDescription();
    	storeProductDescription.setProductId(request.getId());
//    	storeProductDescription.setImage(request.getImage());
//    	storeProductDescription.setSliderImage(request.getSliderImage());
    	storeProductDescription.setUnitName(request.getUnitName());
    	storeProductDescription.setComposition(request.getComposition());
    	storeProductDescription.setDimension(request.getDimension());
    	storeProductDescription.setVideo(request.getVideo());
    	storeProductDescription.setGwpp1(request.getGwpp1());
    	storeProductDescription.setGwmt1(request.getGwmt1());
    	storeProductDescription.setSp1(request.getSp1());
    	storeProductDescription.setSp(request.getSp());
    	storeProductDescription.setMt1(request.getMt1());
    	storeProductDescription.setMt(request.getMt());
    	storeProductDescription.setMx1(request.getMx1());
    	storeProductDescription.setSp2(request.getSp2());
    	storeProductDescription.setSp3(request.getSp3());
    	storeProductDescription.setWeight(request.getWeight());
    	storeProductDescription.setProductionPlace(request.getProductionPlace());
    	storeProductDescription.setDescription(request.getStoreInfo());
    	
    	return storeProductDescription;
    }
    
    public static StoreProductDescription getDescriptionByCrmeb(StoreProductCrmebRequest request) {
    	StoreProductDescription storeProductDescription = new StoreProductDescription();
    	storeProductDescription.setProductId(request.getId());
//    	storeProductDescription.setImage(request.getImage());
//    	storeProductDescription.setSliderImage(request.getSliderImage());
    	storeProductDescription.setUnitName(request.getUnitName());
    	storeProductDescription.setComposition(request.getComposition());
    	storeProductDescription.setDimension(request.getDimension());
    	storeProductDescription.setVideo(request.getVideo());
    	storeProductDescription.setGwpp1(request.getGwpp1());
    	storeProductDescription.setGwmt1(request.getGwmt1());
    	storeProductDescription.setSp1(request.getSp1());
    	storeProductDescription.setSp(request.getSp());
    	storeProductDescription.setMt1(request.getMt1());
    	storeProductDescription.setMt(request.getMt());
    	storeProductDescription.setMx1(request.getMx1());
    	storeProductDescription.setSp2(request.getSp2());
    	storeProductDescription.setSp3(request.getSp3());
    	storeProductDescription.setWeight(request.getWeight());
    	storeProductDescription.setProductionPlace(request.getProductionPlace());
    	storeProductDescription.setDescription(request.getContent());
    	
    	return storeProductDescription;
    }

}
